package com.sh.data.engine.domain.integration.documentCapture.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.sh.data.engine.domain.base.model.PageResult;
import com.sh.data.engine.domain.dataasset.model.domain.TableInfoBizDomain;
import com.sh.data.engine.domain.integration.documentCapture.model.domain.DocumentCaptureDomain;
import com.sh.data.engine.domain.integration.documentCapture.model.param.SaveTaskWithFromTextParam;
import com.sh.data.engine.repository.dao.integration.documentCapture.entity.DocumentCaptureEntity;
import jakarta.servlet.http.HttpServletResponse;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;
import java.util.Map;

/**
 * @author: mengzheng.mhc
 * @date: 2024/6/19 9:55
 */
public interface DocumentCaptureService extends IService<DocumentCaptureEntity> {

    List<List<String>> parseFile(MultipartFile file, Map<String, String[]> parameterMap);

    /**
     * @description : 解析excel
     * @author : tinglan.ys
     * @date : 2022/3/18
     */
    /**
     * @description : 解析csv
     * @author : tinglan.ys
     * @date : 2022/3/18
     */
    List<Map<String, String>> fileParsingCSV(MultipartFile file, String encodeFormat);

    /**
     * @description : 表列表
     * @author : tinglan.ys
     * @date : 2022/3/18
     */
    List<TableInfoBizDomain> getTableList(Long projectId);

    /**
     * @description : 进行数据同步
     * @author : tinglan.ys
     * @date : 2022/3/18
     */
    Boolean saveTaskWithFromText(SaveTaskWithFromTextParam saveTaskWithTextParam);

    /**
     * @description : 业务列表
     * @author : tinglan.ys
     * @date : 2022/3/18
     */
    PageResult<DocumentCaptureDomain> getCaptureList(String tableName, Integer pageNum, Integer pageSize, Long projectId);

    List<String> getLog(Long docCapId);

    Boolean del(Long docCapId);

    String createSql(String fileName, List<String> columnNames, Long projectId);

    Boolean updateDocCap(DocumentCaptureEntity documentCaptureEntity);

    List<DocumentCaptureDomain> getDocTask(Long projectId, String tableName);

    void exportFile(Long id, HttpServletResponse response);
}
